//点击确认按钮
document.getElementById('done').addEventListener('tap', function () {
    var mallName = document.getElementById('mallName').value;
    var username = document.getElementById('username').value;
    var mallAddress = document.getElementById('mallAddress').value;
    var mallMobile = document.getElementById('mallMobile').value;
    var remark=document.getElementById("remark").value;
    var uid=document.getElementById("uid").value;

    //验证输入项是否为空
    if (username == '') {
        document.getElementById('err-msg').innerHTML = '请输入店铺负责人';
    }
    else if (mallMobile == '') {
        document.getElementById('err-msg').innerHTML = '请输入店铺电话';
    }else if (mallName == '') {
        document.getElementById('err-msg').innerHTML = '请输入店铺名称';
    } else if (mallAddress == '') {
        document.getElementById('err-msg').innerHTML = '请输入店铺地址';
    }else if(remark==''){
        document.getElementById('err-msg').innerHTML = '请输入店铺描述';
    }else {
        /*注册*/
        mui.ajax('/admin/register',{
            data:{
                username: username,
                mallName: mallName,
                mallAddress: mallAddress,
                mallMobile: mallMobile,
                remark:remark,
                uid:uid
            },
            type:'get',//HTTP请求类型
            success:function(data){
               location.href="/admin/addBusiness";
            },
            error:function(data){
                console.log('data',data);
            }
        });
    }
})